package com.yuanjiu.data;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuanjiu.service.yuanjiu.DataMergeService;

@Service
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration("classpath:spring.xml")
public class DataMerge {

	@Autowired
	private DataMergeService dataMergeService;
	
//	@Test
	public void merge(){
		Calendar yes = Calendar.getInstance();
		yes.add(Calendar.DAY_OF_MONTH, -1);
		yes.set(Calendar.HOUR_OF_DAY, 0);
		yes.set(Calendar.MINUTE, 0);
		yes.set(Calendar.SECOND, 0);
		dataMergeService.mergeItem(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(yes.getTime()));
		dataMergeService.mergeComment(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(yes.getTime()));
	}
}
